#include <stdio.h>
#include <ctype.h>
#include <string.h>

#include "/home/amba/amba_anu/hnd_gen/headers/all_purpose.h" 	/* For various definition */
#include "/home/amba/amba_anu/hnd_gen/headers/gen.h"                 /* Definition of  following structures */
					/* noun_paradigms, lex, verb_paradigms  */
					/* pronoun_paradogms ,shashti_paradigms */



/* Global varibles for different generator */
int GNP_FLAG;

main(argc,argv)
int argc;
char *argv[];
{
    char result[LARGE];
    char root[LARGE];
    char cat[LARGE];
    char number[SMALL];
    char tam[LARGE];
    char pre_tam[LARGE];
    char post_tam[LARGE];
    char gender[LARGE];
    char person[LARGE];
    char *ptr;
    strcpy(result,"");
    strcpy(root,argv[1]);
    strcpy(cat,argv[2]);
    strcpy(gender,argv[3]);
    strcpy(number,argv[4]);
    strcpy(person,argv[5]);
    strcpy(tam,argv[6]);
    strcpy(pre_tam,"");
    strcpy(post_tam,"");
/*
    printf("%s %s %s %s",argv[1],argv[2],argv[3],argv[4]);
*/
    if((ptr = strchr(tam,'+')) != NULL) {
    *ptr = '\0';
    strcpy(pre_tam , tam);
    strcpy(tam , ptr+1);
    }
    if((ptr = strchr(tam,'~')) != NULL) {
    *ptr = '\0';
    strcpy(post_tam , ptr+1);
    }
    word_gen(result,root,cat,gender,number,person,tam,0,0);
    if(pre_tam[0] != '\0') printf("%s_",pre_tam);
    printf("%s",result);
    if(post_tam[0] != '\0') printf("_%s",post_tam);
}
